<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>安装的艰辛路程 | web前端开发</title>

  <!-- keywords -->
  

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="今天开始安装的，折腾了将近一天的时间，一直安装不上，最后也不知道终于安装上了，太不容易了。 1.安装node环境1234- nodejs.org 网站有 node 的下载链接- 下载得到安装包- 下一步下一步安装即可` 确认机器上是或否有 node 环境： 打开 cmd： 1node -v 2. 安装 githttps://git-scm.com/ 安装方式：直接下一步-&amp;gt;下一步 安装即可">
<meta property="og:type" content="article">
<meta property="og:title" content="安装的艰辛路程">
<meta property="og:url" content="http://yoursite.com/2017/08/23/第一天/index.html">
<meta property="og:site_name" content="web前端开发">
<meta property="og:description" content="今天开始安装的，折腾了将近一天的时间，一直安装不上，最后也不知道终于安装上了，太不容易了。 1.安装node环境1234- nodejs.org 网站有 node 的下载链接- 下载得到安装包- 下一步下一步安装即可` 确认机器上是或否有 node 环境： 打开 cmd： 1node -v 2. 安装 githttps://git-scm.com/ 安装方式：直接下一步-&amp;gt;下一步 安装即可">
<meta property="og:locale" content="中文">
<meta property="og:updated_time" content="2017-08-23T13:40:54.639Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="安装的艰辛路程">
<meta name="twitter:description" content="今天开始安装的，折腾了将近一天的时间，一直安装不上，最后也不知道终于安装上了，太不容易了。 1.安装node环境1234- nodejs.org 网站有 node 的下载链接- 下载得到安装包- 下一步下一步安装即可` 确认机器上是或否有 node 环境： 打开 cmd： 1node -v 2. 安装 githttps://git-scm.com/ 安装方式：直接下一步-&amp;gt;下一步 安装即可">
  
    <link rel="alternative" href="/atom.xml" title="web前端开发" type="application/atom+xml">
  
  
    <link rel="icon" href="http://7xkj1z.com1.z0.glb.clouddn.com/head.jpg">
  
  <link rel="stylesheet" href="/css/style.css">
  
  

  <script src="//cdn.bootcss.com/require.js/2.3.2/require.min.js"></script>
  <script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>

  
</head>
<body>
  <div id="container">
    <div id="particles-js"></div>
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
	<header id="header" class="inner">
		<a href="/" class="profilepic">
			
			<img lazy-src="http://7xkj1z.com1.z0.glb.clouddn.com/head.jpg" class="js-avatar">
			
		</a>

		<hgroup>
		  <h1 class="header-author"><a href="/">黑白色</a></h1>
		</hgroup>

		

		
			<div class="switch-btn">
				<div class="icon">
					<div class="icon-ctn">
						<div class="icon-wrap icon-house" data-idx="0">
							<div class="birdhouse"></div>
							<div class="birdhouse_holes"></div>
						</div>
						<div class="icon-wrap icon-ribbon hide" data-idx="1">
							<div class="ribbon"></div>
						</div>
						
						<div class="icon-wrap icon-link hide" data-idx="2">
							<div class="loopback_l"></div>
							<div class="loopback_r"></div>
						</div>
						
						
					</div>
					
				</div>
				<div class="tips-box hide">
					<div class="tips-arrow"></div>
					<ul class="tips-inner">
						<li>菜单</li>
						<li>标签</li>
						
						<li>友情链接</li>
						
						
					</ul>
				</div>
			</div>
		

		<div class="switch-area">
			<div class="switch-wrap">
				<section class="switch-part switch-part1">
					<nav class="header-menu">
						<ul>
						
							<li><a href="/">主页</a></li>
				        
							<li><a href="/archives">所有文章</a></li>
				        
						</ul>
					</nav>
					<nav class="header-nav">
						<div class="social">
							
						</div>
					</nav>
				</section>
				
				
				<section class="switch-part switch-part2">
					<div class="widget tagcloud" id="js-tagcloud">
						
					</div>
				</section>
				
				
				
				<section class="switch-part switch-part3">
					<div id="js-friends">
					
			          <a target="_blank" class="main-nav-link switch-friends-link" href="https://github.com/smackgg/hexo-theme-smackdown">smackdown</a>
			        
			        </div>
				</section>
				

				
			</div>
		</div>
	</header>				
</div>
    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
  	<div class="overlay">
  		<div class="slider-trigger"></div>
  		<h1 class="header-author js-mobile-header hide">黑白色</h1>
  	</div>
	<div class="intrude-less">
		<header id="header" class="inner">
			<div class="profilepic">
				<img lazy-src="http://7xkj1z.com1.z0.glb.clouddn.com/head.jpg" class="js-avatar">
			</div>
			<hgroup>
			  <h1 class="header-author">黑白色</h1>
			</hgroup>
			
			<nav class="header-menu">
				<ul>
				
					<li><a href="/">主页</a></li>
		        
					<li><a href="/archives">所有文章</a></li>
		        
		        <div class="clearfix"></div>
				</ul>
			</nav>
			<nav class="header-nav">
				<div class="social">
					
				</div>
			</nav>
		</header>				
	</div>
</nav>
      <div class="body-wrap"><article id="post-第一天" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2017/08/23/第一天/" class="article-date">
  	<time datetime="2017-08-23T13:29:12.376Z" itemprop="datePublished">2017-08-23</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      安装的艰辛路程
      
    </h1>
  

      </header>
      
      <div class="article-info article-info-post">
        
        

        
        <div class="clearfix"></div>
      </div>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>今天开始安装的，折腾了将近一天的时间，一直安装不上，最后也不知道终于安装上了，太不容易了。</p>
<h2 id="1-安装node环境"><a href="#1-安装node环境" class="headerlink" title="1.安装node环境"></a>1.安装node环境</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">- nodejs.org 网站有 node 的下载链接</div><div class="line">- 下载得到安装包</div><div class="line">- 下一步下一步安装即可</div><div class="line">`</div></pre></td></tr></table></figure>
<p>确认机器上是或否有 node 环境：</p>
<p>打开 cmd：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">node -v</div></pre></td></tr></table></figure>
<h2 id="2-安装-git"><a href="#2-安装-git" class="headerlink" title="2. 安装 git"></a>2. 安装 git</h2><p><a href="https://git-scm.com/" target="_blank" rel="external">https://git-scm.com/</a></p>
<p>安装方式：直接下一步-&gt;下一步 安装即可</p>
<h2 id="3-安装-hexo"><a href="#3-安装-hexo" class="headerlink" title="3. 安装 hexo"></a>3. 安装 hexo</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm install hexo-cli --global</div></pre></td></tr></table></figure>
<p>接下来可以通过 <code>hexo --version</code> 命令查看是否安装成功：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></td><td class="code"><pre><div class="line">hexo-cli: 1.0.3</div><div class="line">os: Windows_NT 10.0.14393 win32 x64</div><div class="line">http_parser: 2.7.0</div><div class="line">node: 7.10.0</div><div class="line">v8: 5.5.372.43</div><div class="line">uv: 1.11.0</div><div class="line">zlib: 1.2.11</div><div class="line">ares: 1.10.1-DEV</div><div class="line">modules: 51</div><div class="line">openssl: 1.0.2k</div><div class="line">icu: 58.2</div><div class="line">unicode: 9.0</div><div class="line">cldr: 30.0.3</div><div class="line">tz: 2016j</div></pre></td></tr></table></figure></p>
<h2 id="4-生成博客"><a href="#4-生成博客" class="headerlink" title="4. 生成博客"></a>4. 生成博客</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line"><span class="comment"># hexo 会帮你在执行该命名所处的目录生成一个指定名称的目录文件</span></div><div class="line">hexo init 博客目录名称</div></pre></td></tr></table></figure>
<h2 id="5-启动预览博客"><a href="#5-启动预览博客" class="headerlink" title="5. 启动预览博客"></a>5. 启动预览博客</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo server</div></pre></td></tr></table></figure>
<p>线上码云示例：</p>
<h2 id="1-注册码云账号"><a href="#1-注册码云账号" class="headerlink" title="1. 注册码云账号"></a>1. 注册码云账号</h2><h2 id="2-创建仓库（不要初始化-README）"><a href="#2-创建仓库（不要初始化-README）" class="headerlink" title="2. 创建仓库（不要初始化 README）"></a>2. 创建仓库（不要初始化 README）</h2><h2 id="3-拿到仓库地址"><a href="#3-拿到仓库地址" class="headerlink" title="3. 拿到仓库地址"></a>3. 拿到仓库地址</h2><p>本地操作准备：</p>
<p>在 <code>_config.yml</code> 中加入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">deploy:</div><div class="line">  type: git</div><div class="line">  repo: https://lpzdemayun:heima123456@git.oschina.net/lpzdemayun/lpzdemayun.git</div></pre></td></tr></table></figure>
<p>然后安装一个用来快速发布的工具：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm install hexo-deployer-git --save</div></pre></td></tr></table></figure>
<p>然后：执行</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo deploy</div></pre></td></tr></table></figure>
<p>推送成功之后，来到线上仓库，找到 服务 -&gt; Pages -&gt; 开启服务</p>
<p>然后他会告诉你访问哪个地址就可以了。</p>
<p>接下来你只需要写你的文章，每次发布的时候敲一个命令：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line"><span class="comment"># 先生成目录结构，然后发布</span></div><div class="line">hexo generate --deploy</div></pre></td></tr></table></figure>
<h2 id="推荐的安装文章的地址"><a href="#推荐的安装文章的地址" class="headerlink" title="推荐的安装文章的地址"></a>推荐的安装文章的地址</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">-http://www.360doc.com/content/17/0123/14/31460730_624342199.shtml</div></pre></td></tr></table></figure>
      
    </div>
    
  </div>
  
    
<nav id="article-nav">
  
  
    <a href="/2017/08/23/hello-world/" id="article-nav-older" class="article-nav-link-wrap">
      <div class="article-nav-title">Hello World</div>
      <strong class="article-nav-caption">&gt;</strong>
    </a>
  
</nav>

  
</article>


<div class="ds-share share" data-thread-key="第一天" data-title="安装的艰辛路程" data-url="http://yoursite.com/2017/08/23/第一天/"  data-images="http://7xkj1z.com1.z0.glb.clouddn.com/head.jpg" data-content="安装的艰辛路程">
    <div class="ds-share-inline">
      <ul  class="ds-share-icons-16">
      	<li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
        <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
        <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
        <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
        <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>
      </ul>
      <div class="ds-share-icons-more">
      </div>
    </div>
 </div>
 





</div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info">
      <div class="footer-left">
        &copy; 2017 黑白色
      </div>
        <div class="footer-right">
          <a href="http://hexo.io/" target="_blank">Hexo</a>  Theme <a href="https://github.com/smackgg/hexo-theme-smackdown" target="_blank">Smackdown</a>
        </div>
    </div>
  </div>
</footer>
    </div>
    
  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">


<script>
	var yiliaConfig = {
		fancybox: true,
		mathjax: true,
		animate: true,
		isHome: false,
		isPost: true,
		isArchive: false,
		isTag: false,
		isCategory: false,
		open_in_new: false
	}
</script>
<script src="/js/main.js"></script>



<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    }
});

MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';                 
    }       
});
</script>

<script src="//cdn.bootcss.com/mathjax/2.7.0/MathJax.js"></script>


  </div>
</body>
</html>